import React from 'react';
import { Story, Meta } from '@storybook/react';
import PriceChart, { PriceChartProps } from './PriceChart';

export default {
  title: 'Example/PriceChart',
  component: PriceChart,
} as Meta;

const Template: Story<PriceChartProps> = (args) => <PriceChart {...args} />;

const initialState: PriceChartProps = {
    candles: [],
    extremums: [],
    positions: [],
};

const defaultCandles = [
    {
        time: '2023-02-01',
        open: 50,
        high: 120,
        low: 40,
        close: 100,
    },
    {
        time: '2023-02-02',
        open: 100,
        high: 150,
        low: 20,
        close: 20,
    },
];

export const EmptyData = Template.bind({});
EmptyData.args = initialState;

export const ReceivedData = Template.bind({});
ReceivedData.args = {
    candles: defaultCandles, 
    extremums: [], 
    positions: [],
};
